package iteratorbind.impl;


import iteratorbind.base.ArrayMenuIterator;
import iteratorbind.base.BaseMenu;
import iteratorbind.entity.MenuItem;

/**
 * 使用数组存储菜单对象
 * @author yaojianfeng
 */
public class MenuItemArray implements BaseMenu {

    private MenuItem[] menus;
    public MenuItemArray(MenuItem[] menus) {
        this.menus = menus;
    }

    @Override
    public ArrayMenuIterator getIterator(){
        return new ArrayMenuIterator(menus);
    }

    public MenuItem[] getMenus() {
        return menus;
    }


    public void setMenus(MenuItem[] menus) {
        this.menus = menus;
    }
}
